import Vue from 'vue'
import axios from './axios'
import {Toast} from 'vant'
Vue.use(Toast)
export function post (url, data, error="") {
    return new Promise((resolve, reject) => {
        axios.post(url, data).then(res => {
            resolve(res)
        }, err => {
            err = error ? error : err
            Toast(err)
        })
    })
}
export function get (url, data, error="") {
    return new Promise((resolve, reject) => {
        axios.get(url, data).then(res => {
            resolve(res)
        }, err => {
            err = error ? error : err
            Toast(err)
        })
    })
}